<?php 

require_once  $_SERVER['DOCUMENT_ROOT']."/../_lib/base/common.php";
require_once SITE_ROOT_PATH."/_lib/classes/model/BoookingDetails.php";
require_once SITE_ROOT_PATH."/_lib/classes/model/BookingRoons.php";
require_once SITE_ROOT_PATH."/_lib/classes/class.hotel_supplier_low.php";


  session_start();

  $booking_id = $_SESSION["booking"]["booking_id"]; 
  $booking_details = new BoookingDetails();
  $booking = $booking_details->get_booking_with_details_by_booking_id($booking_id);
  $hotelLow = new hotel_supplier_low();  
  $hotel = $hotelLow->get_hotel_description($booking[0]['supplier_hotel_id']);
  $rooms = new BookingRoons();
  $booking_rooms = $rooms->get_booking_rooms_by_booking_detail_id($booking[0]['booking_detail_id']);
  $booking_rooms = $booking_rooms;
  $booking = $booking[0];
  


?>

<html>

    <HEAD>
        <meta http-equiv="Content-Type" content="text/html"; charset="iso-8859-1">
    </head>
    <body topmargin="0" rightmargin="0" leftmargin="0" alink="#006699" vlink="#006699" link="#006699" text="#333333" bgcolor="#f1f1f1">

        <table cellspacing="0" cellpadding="0" border="0" width="100%" bgcolor="#f1f1f1">
        <colgroup>
        <col width="100%">
        </colgroup>
        <tr>
        <td width="100%" align="center" valign="top">




        <table width="600" cellspacing="0" cellpadding="0" border="0">
        <colgroup>
        <col width="600">
        </colgroup>
        <tr>
        <td width="600" align="left" valign="top">





        <table width="600" cellspacing="0" cellpadding="0" border="0">
        <colgroup>
            <col width="300">
            <col width="300">
        </colgroup>
        <tr>
            <td width="300" align="left" valign="top">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td><a href="http://www.latedeals.ie" target="_blank" style="color:#666666; font-weight:normal; text-decoration:underline; font-family:Verdana, Geneva, sans-serif; font-size:10px">LateDeals.ie</a></td>
                    </tr>
                    <tr>
                        <td><span style="font-size:10px; color:#666666; font-weight:normal; font-family:Verdana, Geneva, sans-serif; ">Voucher Reference: <?= $booking['supplier_booking_ref'] ?></span></td>
                    </tr>
                </table>
            </td>
            <td width="300" align="right" valign="top">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td valign="top" align="right"><span style="font-size:10px; color:#666666; font-weight:normal; text-decoration:underline; font-family:Verdana, Geneva, sans-serif; ">If you can not see this email <a target="_blank" href="#">click here</a></span></td>
                    </tr>
                    <tr>
                        <td align="left" valign="top"><span style="font-size:10px; color:#666666; font-weight:normal; text-decoration:underline; font-family:Verdana, Geneva, sans-serif; "><a target="_blank" href="#" style="font-size:10px; color:#666666; font-weight:normal; text-decoration:underline; font-family:Verdana, Geneva, sans-serif; ">Printer friendly version</a> | <a target="_blank" href="#" style="font-size:10px; color:#666666; font-weight:normal; text-decoration:underline; font-family:Verdana, Geneva, sans-serif; ">Add to your safe list</a></td>
                    </tr>
                </table>
            </td>
        </tr>
        </table>

        <table width="600" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff">
        <colgroup>
        <col width="10">
        <col width="580">
        <col width="10">
        </colgroup>
        <tr>
        <td width="10"><img src="http://www.latedeals.ie/images/pixel.gif" width="10" height="1" hspace="0"></td>
        <td width="580" align="left" valign="top">







        <table width="580" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff">
            <colgroup>
                <col width="390">
                <col width="280">
            </colgroup>
            <tr>
                <td width="300" align="left" valign="top"><a href="http://www.latedeals.ie" target="_blank"><img src="http://www.latedeals.ie/images/logo_email.gif" vspace="0" hspace="0" border="0" style="display:block;" alt="LateDeals.ie" width="300" height="65"></a></td>
                <td width="280" align="left" valign="top"><img src="http://www.latedeals.ie/images/pixel.gif" vspace="0" hspace="0" border="0" style="display:block;" alt="" width="280" height="65"></td>
            </tr>
        </table>








        <table width="580" cellspacing="0" cellpadding="0" border="0">
        <colgroup>
        <col width="580">
        </colgroup>
        <tr>
        <td height="10"><img src="http://www.latedeals.ie/images/pixel.gif" width="1" height="20" vspace="0" style="display:block;"></td>
        </tr>
        <tr>
        <td width="580" align="left"><span style="font-size: 25px; font-family: Arial, Helvetica, sans-serif; color:#000">Accommodation Voucher</span></td>
        </tr>
        <tr>
        <td height="10"><img src="http://www.latedeals.ie/images/pixel.gif" width="1" height="30" vspace="0" style="display:block;"></td>
        </tr>
        <tr>
        <td width="580" align="left"><span style="font-size: 18px; font-family: Arial, Helvetica, sans-serif; color:#000">This Voucher must be presented to the hotel reception on arrival</span></td>
        </tr>
        <tr>
        <td height="10"><img src="http://www.latedeals.ie/images/pixel.gif" width="1" height="30" vspace="0" style="display:block;"></td>
        </tr>
        <tr>
            <td width="580" align="left" valign="top"><span style="font-size: 18px; font-family: Arial, Helvetica, sans-serif; color:#cc6600">VOUCHER DETAILS</span></td>
        </tr>
        <tr>
        <td height="10"><img src="http://www.latedeals.ie/images/pixel.gif" width="1" height="10" vspace="0" style="display:block;"></td>
        </tr>
        <tr>
        <td height="1" bgcolor="#cc6600"><img src="http://www.latedeals.ie/images/pixel.gif" width="1" height="1" vspace="0" style="display:block;"></td>
        </tr>
        <tr>
        <td height="10"><img src="http://www.latedeals.ie/images/pixel.gif" width="1" height="10" vspace="0" style="display:block;"></td>
        </tr>
        <tr>
        <td width="580" align="left" valign="top">
        <table width="580" cellspacing="0" cellpadding="0" border="0">
        <colgroup>
        <col width="580" />
        </colgroup>
        <tr>	
        <td width="580" valign="top" align="left">
        <table width="580" cellspacing="0" cellpadding="2" border="0">
            <colgroup>
                <col width="210" />
                <col width="370" />
            </colgroup>
            <tr>
                <td width="210" valign="top" align="left"><span></span></td>
                <td width="370" valign="top" align="left"><span></span></td>
            </tr>
            <tr>
                <td width="210" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><b>Voucher Reference</b></span></td>
                <td width="370" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><b><?= $booking['supplier_booking_ref'] ?></b></span></td>
            </tr>
            <tr>
                <td width="210" valign="top" align="left"><span></span></td>
                <td width="370" valign="top" align="left"><span></span></td>
            </tr>
            <tr>
                <td width="210" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><b>Lead Guest</b></span></td>
                <td width="370" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><?= $booking['customer_tittle'] .' '. $booking['customer_first_name'].' '. $booking['customer_last_name'] ?></span></td>
            </tr>
            <tr>
                <td width="210" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><b>Date of Booking</b></span></td>
                <td width="370" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><?= date('d/m/Y', $booking['booking_date']); ?></span></td>
            </tr>
            <tr>
                <td width="210" valign="top" align="left"><span></span></td>
                <td width="370" valign="top" align="left"><span></span></td>
            </tr>
            <tr>
                <td width="210" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><b>Accommodation name</b></span></td>
                <td width="370" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><?= $hotel[0]["Property"] ?></span></td>
            </tr>
            <tr>
                <td width="210" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><b>Accommodation address</b></span></td>
                <td width="370" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><?= $hotel[0]["Address"] ?>, <?= $hotel[0]["resort"] ?>, <?= $hotel[0]["region"] ?>, <?= $hotel[0]["country"]?></span></td>
            </tr>
            <tr>
                <td width="210" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><b>Check in</b></span></td>
                <td width="370" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><?= date('d/m/Y', $booking['check_in_date']); ?></span></td>
            </tr>
            <tr>
                <td width="210" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><b>Check out</b></span></td>
                <td width="370" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><?= date('d/m/Y', $booking['check_out_date']); ?></span></td>
            </tr>
            <tr>
                <td width="210" valign="top" align="left"><span></span></td>
                <td width="370" valign="top" align="left"><span></span></td>
            </tr>
            <?php foreach ($booking_rooms as $key => $room) { ?>
                
            <tr>
                <td width="210" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><b>Room <?= $key + 1?></b></span></td>
                <td width="370" valign="top" align="left"><span  style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><?= $room['room_type'] ?></span></td>
            </tr>
            <tr>
                <td width="210" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><b>Board</b></span></td>
                <td width="370" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><?= $room['board_basis_code'] ?></span></td>
            </tr>
            <tr>
                <td width="210" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><b>Occupancy</b></span></td>
                <td width="370" valign="top" align="left">
                    <table width="200" cellspacing="0" cellpadding="2" border="0">
                        <colgroup>
                            <col width="80" />
                            <col width="100" />
                        </colgroup>
                        <tr>
                            <td width="80" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><b>Adults</b></span></td>
                            <td width="100" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><?= $room['num_adult'] ?></span></td>
                        </tr>
                        <tr>
                            <td width="80" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><b>Children</b></span></td>
                            <td width="100" valign="top" align="left"><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color:#000"><?= $room['num_child'] ?></span></td>
                        </tr>
                    </table>
                </td>
            </tr>
            <?php }?>
            <tr>
                <td width="210" valign="top" align="left"><span></span></td>
                <td width="370" valign="top" align="left"><span></span></td>
            </tr>
            <tr>
            </tr>
            <tr>
                <td width="210" valign="top" align="left"><span></span></td>
                <td width="370" valign="top" align="left"><span></span></td>
            </tr>
        </table>
        </td>
        </tr>
        </table>
        </td>
        </tr>
        <tr>
        <td width="580" align="left" valign="top"><span style="font-size: 18px; font-family: Arial, Helvetica, sans-serif; color:#cc6600">ADDITIONAL INFORMATION</span></td>
        </tr>
        <tr>
        <td height="10"><img src="http://www.latedeals.ie/images/pixel.gif" width="1" height="10" vspace="0" style="display:block;"></td>
        </tr>
        <tr>
        <td height="1" bgcolor="#cc6600"><img src="http://www.latedeals.ie/images/pixel.gif" width="1" height="1" vspace="0" style="display:block;"></td>
        </tr>
        <tr>
        <td height="10"><img src="http://www.latedeals.ie/images/pixel.gif" width="1" height="10" vspace="0" style="display:block;"></td>
        </tr>
        <tr>
        <td width="580" align="left" valign="top">
        <table width="580" cellspacing="0" cellpadding="0" border="0">
        <colgroup>
        <col width="580">
        </colgroup>
        <tr>
        <td width="580" align="left" valign="top"><span style="font-size: 11px; font-family: Arial, Helvetica, sans-serif; color:#000000">
          <?php if ($hotel[0]['Telephone']){ ?>      
             Should you have any difficulties on arrival in resort, it is essential you ring the following number <?= $hotel[0]['Telephone']?>.<br/><br/>
          <?php }?>   
        This booking has been made subject to our standard terms and conditions. We are not liable for any extensions, upgrades or accommodation extras arranged by you on arrival in resort.<br/><br/>

        Thank you for booking with LateDeals.ie</td>
        </tr>
        <tr>
        <td height="10"><img src="http://www.latedeals.ie/images/pixel.gif" width="1" height="10" vspace="0" hspace="0" border="0"></td>
        </tr>
        </table>


        </td>
        </tr>
        </table>







        </td>
        <td width="10"><img src="http://www.latedeals.ie/images/pixel.gif" width="10" height="1" hspace="0"></td>
        </tr>
        </table>







        <table width="600" cellspacing="0" cellpadding="0" border="0">
        <colgroup>
            <col width="300">
            <col width="300">
        </colgroup>
        <tr>
        <td width="300" align="left" valign="top">


        <span style="color:#666666; font-weight:normal; font-family:Verdana, Geneva, sans-serif; font-size:10px">
        LateDeals.ie,<br>

        Supersun Travel Limited,<br>

        Media Cube,<br>

        Kill Avenue,<br>

        Dun Laoghaire, <br>
        Co. Dublin,<br>

        Ireland<br>
        </span>
        <br>
        <a href="http://www.latedeals.ie" target="_blank" style="color:#666666; font-weight:normal; text-decoration:underline; font-family:Verdana, Geneva, sans-serif; font-size:10px">LateDeals.ie</a>




        </td>
        <td width="300" align="right" valign="top">&nbsp;</td>
        </tr>
        </table>






        </td>
        </tr>
        </table>








        </td>
        </tr>
        </table>

    </body>
</html>